<template>
  <div class="music-container">
    <top-bar>
      <div class="top_bar">
        <search-view :data="data"></search-view>
        <weather></weather>
        <theme :data=themes></theme>
      </div>
    </top-bar>

    <!--      内容区-->
    <div class="music-content">

      <!--        左边内容区-->
      <div class="music-left right-screen list-y">

        <div class="music-left-top">

          <div class="music-swiper">
            <cascade-swiper></cascade-swiper>
          </div>

          <div class="music-top-song">

            <music-hot-info :data="musicData"></music-hot-info>
<!--            <hot-info :data="musicData"></hot-info>-->
          </div>

        </div>
        <div class="music-left-middle">

          <div class="cate-item" v-for="item in categoryData" :key="item.id">
            <music-cate-gory-card :item="item"></music-cate-gory-card>
          </div>
        </div>
        <div class="music-left-bottom">
          <div class="bottom-title">
            歌单推荐
          </div>
          <div class="bottom-nav-bar">
            <p>为你推荐</p>
            <p>情歌</p>
            <p>学习工作</p>
            <p>古风</p>
            <p>摇滚</p>
            <p>90年代</p>
          </div>
          <div class="bottom-list list-x">
            <div class="card">
              <div class="music-card-image item1"></div>
              <div class="music-card-info">
                <span>才子词人， 许嵩给别人创造的歌曲</span>
                <span>播放量：103万</span>
              </div>
            </div>
            <div class="card">
              <div class="music-card-image item3"></div>
              <div class="music-card-info">
                <span>才子词人， 许嵩给别人创造的歌曲</span>
                <span>播放量：103万</span>
              </div>
            </div>

            <div class="card">
              <div class="music-card-image item2"></div>
              <div class="music-card-info">
                <span>谁能拒绝彭小冉的红衣造型呢</span>
                <span>播放量：78万</span>
              </div>
            </div>

          </div>

        </div>

      </div>

      <!--        右边-->
      <div class="music-right right-screen">


        <div class="right-label">
          <div class="author">音乐制作人</div>
          <div class="more-recommend">更多推荐</div>

        </div>
        <!--        右边内容区-->
        <div class="music-author">


          <div class="author-list  list-y">
            <author-card :message="i" v-for="i in authorData" :key="i.id"></author-card>
          </div>
        </div>
        <div class="music-player">
          <music-player-card></music-player-card>
        </div>

      </div>
    </div>


  </div>

</template>

<script lang="ts" setup>
import TopBar from "@/components/top-bar.vue"
import SearchView from "@/components/search.vue"
import Weather from "@/components/weather.vue"
import Theme from "@/components/theme.vue"
import AuthorCard from "@/components/author-card.vue"
import {reactive} from "vue";
import {themes} from "@/config/data";
import MusicCateGoryCard from "@/components/music-category-card.vue"
import MusicPlayerCard from "@/components/music-palyer-card.vue"
import CascadeSwiper from "@/components/cascade-swiper.vue"
import AuthorJson from "@/assets/data/music-author.json"
import musicInfoJson from "@/assets/data/music-infos.json"
import MusicHotInfo from "@/components/music-hot-info.vue";

const data = reactive<Array<string>>(['hello', 'world'])
const musicData = musicInfoJson
const authorData = AuthorJson

const categoryData = [{
  id: 1,
  label: '猜你喜欢',
  image: '../src/assets/icons/flower.png',
  bgColor: 'linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%)'
},
  {
    id: 2,
    label: '每日推荐',
    image: '../src/assets/icons/calendar.png',
    bgColor: 'linear-gradient(to top, #f43b47 0%, #453a94 100%)'
  },
  {
    id: 3,
    label: '排行榜',
    image: '../src/assets/icons/category.png',
    bgColor: 'linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%)'
  }, {
    id: 4,
    label: '分类',
    image: '../src/assets/icons/hhaahha.png',
    bgColor: 'linear-gradient(to top, #e8198b 0%, #c7eafd 100%)'
  }]


</script>

<style lang="less" scoped>
.music-container {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;

  .top_bar {
    display: flex;
    -webkit-app-region: drag; //设置可拖拽，但是要在子组件不需要拖到的地方取消，不然会失焦
    align-content: center;
    justify-content: space-between;
  }

  .music-content {
    display: flex;
    height: 100%;
    width: 100%;
    margin-top: 10px;

    .music-left {
      flex: 1;
      display: flex;
      gap: 5px;
      flex-direction: column;

      .music-left-top {
        width: 100%;
        height: 52%;
        display: flex;
        gap: 10px;

        .music-swiper {
          width: 60%;
          height: 92%;
        }
        .music-top-song{
          width: 35%;
          height: 100%;
          border-radius: 20px;
          box-shadow: 5px 5px 5px rgba(122, 95, 95, 0.5);
          background-color: rgba(255, 255, 255, 0.2);
          backdrop-filter: blur(10px);
          display: flex;
          flex-direction: column;
        }

      }


      .music-left-middle {
        width: 100%;
        height: 16%;
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(4, 1fr);
      }


      .music-left-bottom {
        width: 100%;
        height: 36%;
        display: flex;
        margin-top: 10px;
        color: white;
        flex-direction: column;
        align-items: center;

        .bottom-nav-bar {
          width: 60%;
          display: flex;
          align-items: center;
          font-size: 12px;
          justify-content: space-evenly;
        }

        .bottom-list {
          width: 100%;
          height: 100%;
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 10px;
          align-items: center;

          .card {
            width: 100%;
            height: 85%;
            border-radius: 10px;
            display: flex;
            margin: 10px 0;
            backdrop-filter: blur(2px);
            box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;

            .music-card-image {
              width: 45%;
              height: 100%;
              margin-left: 10px;
              border-radius: 10px 0 0 10px;
              background-repeat: no-repeat;
              background-position: center;
              background-size: 100%;
            }

            .item3 {
              background-image: url("@/assets/images/mc2.png");

            }

            .item2 {
              background-image: url("@/assets/images/mc1.png");
            }

            .item1 {
              background-image: url("@/assets/images/music-avatar.jpg");

            }

            .music-card-info {
              display: flex;
              flex: 1;
              color: white;
              padding: 10px;
              flex-direction: column;
              justify-content: space-between;
              font-size: 12px;
            }

            .music-card-info :nth-child(2) {
              font-size: 10px;
              color: #c2c2c2;
            }

          }
        }
      }
    }

    .music-right {
      width: 28%;
      padding: 5px;
      display: flex;
      flex-direction: column;
      border-radius: 15px;

      .right-label {
        width: 100%;
        height: 5%;
        justify-content: space-between;
        display: flex;
        padding: 0 10px;
        align-items: end;

        .author {
          color: white;
        }

        .more-recommend {
          color: white;
          font-size: 12px;
          cursor: pointer;
        }

        .more-recommend:hover {
          color: #86A8E7;
        }
      }

      .music-author {
        height: 50%;
        margin-bottom: 10px;

        .author-list {
          height: 100%;
          width: 100%;
          padding: 0 10px;
        }
      }

      .music-player {
        height: 45%;
        margin-bottom: -20px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }


  }
}

</style>